<?php
/**
 * Geocontexter
 * @link http://code.google.com/p/geocontexter/
 * @package Geocontexter
 */

/**
 * Admin index controller
 *
 *
 * @package Geocontexter
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @author Armand Turpel <geocontexter@gmail.com>
 * @version $Rev$ / $LastChangedDate$ / $LastChangedBy$
 */

namespace Gospecies\Controller;

use Zend\View\Model\ViewModel;
use Gospecies\Controller\AbstractIdentityController;


class DataEntryController extends AbstractIdentityController
{

    protected function init($controller)
    {
        $this->initView( 'gospecies/data-entry/index.phtml');

        $this->view->active_page = 'dataentry';
    }

    public function indexAction()
    {
        $user = $this->get_identity();

        $this->view->user = array('id_user'        => $user->id_user,
                                  'id_status'      => $user->id_status,
                                  'id_group'       => $user->id_group,
                                  'lang'           => $user->lang,
                                  'user_forename'  => $user->user_forename,
                                  'user_lastname'  => $user->user_lastname,
                                  'user_email'     => $user->user_email
                                  );

        $ListGetChilds = $this->CoreModel('ListGetChilds');

        $params  = array('id_parent'     => 0) ;

        $this->view->list_result = $ListGetChilds->run( $params );

        $this->sessionOffsetUnset('tmp_image_path');

        $this->view->record_status = 'insert';

        return $this->view;
    }
}
